

// const details = {
//     url: 'https://www.baidu.com/',
//     name: 'PSTM',
// }
// chrome.cookies.get(details, function(cookie) {
//     console.log('background', cookie)
// })

console.log('background')

chrome.run.onMessage.addListener(function(res, sender, sendResponse) {
    console.log(res)

    sendResponse()
    return true
})

function sendMessage(obj) {
    chrome.tabs.query({ active: true, lastFocusedWindow: true }, function(tabs) {
        chrome.tabs.sendMessage(tabs.length ? tabs[0].id : null, obj, function(response) {
            console.log(98765, response)
        })
    })
}